package designpattern.command.ricecooker;

public class RiceCookerReceiver {
    private static boolean flag = false;
    public void open(){
        flag = true;
        System.out.println("open it");
    }
    public void close(){
        flag = false;
        System.out.println("close it");
    }
    public void cookRice(){
        if (flag)
            System.out.println("start cooking rice");
        else
            System.out.println("please open the rice cooker , than cook rice");
    }
}
